package com.reader.cms.entity.magazine;

import java.io.Serializable;

import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;
import java.util.List;

import com.baomidou.mybatisplus.enums.FieldStrategy;
import com.baomidou.mybatisplus.enums.IdType;
import com.reader.core.validator.group.AddGroup;
import com.reader.core.validator.group.UpdateGroup;
import org.springframework.format.annotation.DateTimeFormat;
import com.baomidou.mybatisplus.annotations.TableName;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 *
 * @@description
 * @author        jiahaikun
 * @date          2018-10-29
 */
@TableName("reader_magazine_content")
public class ReaderMagazineContent extends Model<ReaderMagazineContent> {

	private static final long serialVersionUID = 1L;


	/**
	 * ID
	 */

	@TableId(value="id", type= IdType.INPUT)
	private String id;

	/**
	 * 标题
	 */

	@NotBlank(message="文章标题不能为空！！！", groups = {AddGroup.class, UpdateGroup.class})
	private String title;

	/**
	 * 作者
	 */

	private String author;

	/**
	 * 译者
	 */

	private String translator;

	/**
	 * 来源
	 */


	private String origin;

	/**
	 * 所属杂志ID
	 */

	@TableField("magazine_id")
	@NotBlank(message="选择杂志为必选项！！！", groups = {AddGroup.class, UpdateGroup.class})
	private String magazineId;

	/**
	 * 封面图片
	 */

	@NotBlank(message="文章封面图不能为空！！！", groups = {AddGroup.class, UpdateGroup.class})
	private String cover;

	/**
	 * 杂志介绍
	 */


	private String introduction;

	/**
	 * 关联杂志栏目分类表reader_magazine_column
	 */

	@TableField("column_id")
	@NotNull(message="杂志栏目为必选项！！！", groups = {AddGroup.class, UpdateGroup.class})
	private Integer columnId;

	/**
	 * 不允许：0 ,允许:1
	 */

	@TableField("trial_read")

	private Integer trialRead;

	/**
	 * 文章总字数，用于计算阅读时长
	 */

	@TableField("word_cnt")

	private Integer wordCnt;

	/**
	 * 内容中图片总数量，用于计算阅读时长
	 */

	@TableField("pic_cnt")

	private Integer picCnt;

	/**
	 * 发布时间
	 */

	@TableField("publish_dt")

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date publishDt;

	/**
	 * 公共代码：CONT_STAT内容状态
	 */


	private String state;



	private Integer enable;


	@TableField("del_flag")

	private Integer delFlag;


	@TableField("insert_dt")

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date insertDt;


	@TableField("insert_user_id")

	private Integer insertUserId;


	@TableField("updt_dt")

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date updtDt;


	@TableField("updt_user_id")

	private Integer updtUserId;



	private String remark;


	/**
	 * 关联内容分类表
	 */

	@TableField(exist = false)

	private List<Integer> contentClassifies;


	@TableField(exist = false)
	private List<Integer> tagIds;

	@TableField(exist = false)
	@NotBlank(message="文章内容不能为空！！！", groups = {AddGroup.class, UpdateGroup.class})
	private String content;

	@TableField(exist = false)
	private String columnNm;

	@TableField(exist = false)
	private Integer likeNum;

	@TableField(exist = false)
	private String promulgator;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getTranslator() {
		return translator;
	}

	public void setTranslator(String translator) {
		this.translator = translator;
	}

	public String getOrigin() {
		return origin;
	}

	public void setOrigin(String origin) {
		this.origin = origin;
	}

	public String getMagazineId() {
		return magazineId;
	}

	public void setMagazineId(String magazineId) {
		this.magazineId = magazineId;
	}

	public String getCover() {
		return cover;
	}

	public void setCover(String cover) {
		this.cover = cover;
	}

	public String getIntroduction() {
		return introduction;
	}

	public void setIntroduction(String introduction) {
		this.introduction = introduction;
	}

	public Integer getColumnId() {
		return columnId;
	}

	public void setColumnId(Integer columnId) {
		this.columnId = columnId;
	}

	public Integer getTrialRead() {
		return trialRead;
	}

	public void setTrialRead(Integer trialRead) {
		this.trialRead = trialRead;
	}

	public Integer getWordCnt() {
		return wordCnt;
	}

	public void setWordCnt(Integer wordCnt) {
		this.wordCnt = wordCnt;
	}

	public Integer getPicCnt() {
		return picCnt;
	}

	public void setPicCnt(Integer picCnt) {
		this.picCnt = picCnt;
	}

	public Date getPublishDt() {
		return publishDt;
	}

	public void setPublishDt(Date publishDt) {
		this.publishDt = publishDt;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public Integer getEnable() {
		return enable;
	}

	public void setEnable(Integer enable) {
		this.enable = enable;
	}

	public Integer getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(Integer delFlag) {
		this.delFlag = delFlag;
	}

	public Date getInsertDt() {
		return insertDt;
	}

	public void setInsertDt(Date insertDt) {
		this.insertDt = insertDt;
	}

	public Integer getInsertUserId() {
		return insertUserId;
	}

	public void setInsertUserId(Integer insertUserId) {
		this.insertUserId = insertUserId;
	}

	public Date getUpdtDt() {
		return updtDt;
	}

	public void setUpdtDt(Date updtDt) {
		this.updtDt = updtDt;
	}

	public Integer getUpdtUserId() {
		return updtUserId;
	}

	public void setUpdtUserId(Integer updtUserId) {
		this.updtUserId = updtUserId;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getColumnNm() {
		return columnNm;
	}

	public void setColumnNm(String columnNm) {
		this.columnNm = columnNm;
	}

	public Integer getLikeNum() {
		return likeNum;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public void setLikeNum(Integer likeNum) {
		this.likeNum = likeNum;
	}

	public List<Integer> getTagIds() {
		return tagIds;
	}

	public List<Integer> getContentClassifies() {
		return contentClassifies;
	}

	public void setContentClassifies(List<Integer> contentClassifies) {
		this.contentClassifies = contentClassifies;
	}

	public void setTagIds(List<Integer> tagIds) {
		this.tagIds = tagIds;
	}

	public String getPromulgator() {
		return promulgator;
	}

	public void setPromulgator(String promulgator) {
		this.promulgator = promulgator;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

	@Override
	public String toString() {
		return "ReaderMagazineContent{" +
				", id=" + id +
				", title=" + title +
				", author=" + author +
				", translator=" + translator +
				", origin=" + origin +
				", magazineId=" + magazineId +
				", cover=" + cover +
				", introduction=" + introduction +
				", column=" + columnId +
				", trialRead=" + trialRead +
				", wordCnt=" + wordCnt +
				", picCnt=" + picCnt +
				", publishDt=" + publishDt +
				", state=" + state +
				", enable=" + enable +
				", delFlag=" + delFlag +
				", insertDt=" + insertDt +
				", insertUserId=" + insertUserId +
				", updtDt=" + updtDt +
				", updtUserId=" + updtUserId +
				", remark=" + remark +
				"}";
	}
}
